#include"comm.hpp"
#include<unistd.h>
#include<sys/types.h>
#include<sys/stat.h>

int main()
{
    //创建共享内存
    key_t shmid=CreateShm();

    //关联
    char* addr=(char*)shmat(shmid,nullptr,0);

    int fd=open(FIFOFILE,O_RDONLY);
    while(true){
        char c;
        int n=read(fd,&c,1);

        cout<<"client say: "<<addr<<endl;
        sleep(1);
    }

    //去关联
    int n=shmdt(addr);
    return 0;
}